package top.shiyiri.spring5.test;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import top.shiyiri.spring5.service.UserService;

/**
 * Spring框架整合 JUnit5
 * @author Aunean
 * @date 2022/2/18 21:21
 */
//@ExtendWith(SpringExtension.class) //单元测试框架
//@ContextConfiguration("classpath:bean1.xml") //加载配置文件

@SpringJUnitConfig(locations="classpath:bean1.xml")
public class JTest5 {

    @Autowired
    private UserService userService;

    @Test
    public void test1() {
        userService.accountMoney();
    }
}
